package spring.cloud.consumer.movie.ribbon.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import spring.cloud.consumer.movie.ribbon.user.entity.User;
import spring.cloud.consumer.movie.ribbon.user.service.RibbonService;

/**
 * Created by Enven on 2016/9/8.
 */
@RestController //@RestController注解相当于@ResponseBody ＋ @Controller合在一起的作用
public class RibbonController {
    @Autowired
    private RibbonService ribbonService;

    @GetMapping("/ribbon/{id}")
    public User findById(@PathVariable Long id) {
        return this.ribbonService.findById(id);
    }
}
